﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Soft
{
    /// <summary>
    /// 全局设置
    /// </summary>
    public static class FactoryAdvisorPlatformGlobalSet
    {


        static FactoryAdvisorPlatformGlobalSet()
        {
            FactoryAdvisorPlatformGlobalSet.IsWebDomain = (Environment.CurrentDirectory + "\\" != AppDomain.CurrentDomain.BaseDirectory);
        }


        /// <summary>
        /// 一个星期的第一天
        /// </summary>
        public static DayOfWeek FirstDayOfWeek { get; set; } = DayOfWeek.Monday;


        /// <summary>
        /// 指示该年的第一周是具有四个或多个天之前指定的第一个日期是星期几的第一周。 值为 2。
        /// </summary>
        public static CalendarWeekRule CalendarWeekRule { get; set; } = CalendarWeekRule.FirstFourDayWeek;


        /// <summary>
        /// mysql数据库的最小时间
        /// </summary>
        public static DateTime MSSqlDateTimeMinValue { get; private set; } = BackgroundSet.DatabaseDateTimeMinValue(DBType.SqlServer);

 
        /// <summary>
        /// 应用程序的路径
        /// </summary>
        public static string ApplicationPath { get; private set; } = AppDomain.CurrentDomain.BaseDirectory;

 
        /// <summary>
        ///是否是Web引用 
        /// </summary>
        public static bool IsWebDomain { get; private set; }


        /// <summary>
        /// 应用的名称
        /// </summary>
        public static string ApplicationName { get; private set; } = AppDomain.CurrentDomain.SetupInformation.ApplicationName;


        /// <summary>
        /// 是否超过极限时间
        /// </summary>
        internal static readonly int[] FuseSign = new int[]
        {
            9999,
            24,
            124
        };

     
        /// <summary>
        /// 加密Key
        /// </summary>
        internal static readonly string StringEncryptKey = "^yHnMkO0";


        /// <summary>
        /// 默认实例名称
        /// </summary>
        public const string SYSTEM_DEFAULT_INSTANCE_NAME = "SEFAJOBSERVICE";


       /// <summary>
       /// 默认实例名称 正则匹配模式
       /// </summary>
        public static readonly string SYSTEM_INSTANCE_NAME_MATCH_PATTERN = "[a-zA-Z_]+[a-zA-Z_\\d]*";


        /// <summary>
        /// 默认实例 最大名字的长度
        /// </summary>
        public static readonly byte SYSTEM_INSTANCE_NAME_MAX_LENGTH = 32;

      
        /// <summary>
        /// 数字 转成字符串的格式  0.00###
        /// </summary>
        public static readonly string NumericToStringFormat = "0.0###";



    }
}
